package controllers;
import java.util.logging.Logger;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.googlecode.objectify.ObjectifyService;
import models.SolutionSubmission;
import models.SolutionAdoption;
import models.Rating;
import models.Recommend;
import models.UserActions;

public class AppServletContextListener implements ServletContextListener{
	 
	private static final Logger log = Logger.getLogger(AppServletContextListener.class.getName());
	
	@Override
	public void contextDestroyed(ServletContextEvent arg0) {

	}
 
	@Override
	public void contextInitialized(ServletContextEvent arg0) {		
		ObjectifyService.register(SolutionSubmission.class);
		ObjectifyService.register(SolutionAdoption.class);
		ObjectifyService.register(Rating.class);
		ObjectifyService.register(Recommend.class);
		ObjectifyService.register(UserActions.class);
		
		log.info("Loaded SolutionSubmission, SolutionAdoption, Rating and Recommend Class in the Objectify");
	}
}